<div class="col-md-12" id="admin-page">
    <h3 align="center">Users management</h3>

    <div class="row">
        <div class="col-md-12">
            <button class="btn btn-success pull-right" ng-click="createUser()">Create new user</button>
        </div>
    </div>

    <br>

    <div class="row">
        <uib-accordion class="col-md-12" close-others="true">
            <uib-accordion-group ng-repeat="user in users | orderBy:'name' | orderBy:'disabled' | filter:$root.search:'login'">
                <uib-accordion-heading>
                    <div class="row">
                        <div class="col-sm-12">
                            <span ng-bind="user.login" title="login"></span>
                            <span class="label label-danger" ng-if="user.disabled">disabled</span>
                        </div>
                    </div>
                </uib-accordion-heading>

                <div class="row">
                    <div class="col-md-12">
                        <form>
                            <div class="form-group">
                                <label for="{{ user.login }}Login">Login</label>
                                <input class="form-control" id="{{ user.login }}Login" placeholder="Username" ng-model="user.login">
                            </div>
                            <div class="form-group">
                                <label for="{{ user.login }}Email">Email address</label>
                                <input type="email" class="form-control" id="{{ user.login }}Email" placeholder="Email" ng-model="user.email">
                            </div>
                            <div class="form-group">
                                <label for="{{ user.login }}Password">Password</label>
                                <input type="password" class="form-control" id="{{ user.login }}Password" placeholder="Password" ng-model="user.password">
                            </div>
                            <div class="checkbox">
                                <label for="{{ user.login }}Disabled">
                                    <input type="checkbox" id="{{ user.login }}Disabled" ng-model="user.disabled"> Disabled
                                </label>
                            </div>
                            <div class="checkbox">
                                <label for="{{ user.login }}Admin">
                                    <input type="checkbox" id="{{ user.login }}Admin" ng-model="user.is_admin"> Admin privileges
                                </label>
                            </div>
                            <button class="btn btn-success" ng-click="updateUser(user)">Submit</button>
                            <button class="btn btn-danger" ng-click="deleteUser(user)">Delete user</button>
                        </form>
                    </div>
                </div>
            </uib-accordion-group>
        </uib-accordion>
    </div>
</div>